//引入封装好的接口
import {getCateList} from '../../../request/api'
const state = {
    cateList:[]
}  
const getters = {
    getCateList(state){
        return state.cateList
    }
}
const mutations = {
    REQ_CATELIST(state,payload){
        state.cateList = payload
    }
} 
const actions = {
    //获取菜单列表
    getCateListAction({commit}){
        getCateList()
        .then(res=>{
            if(res.code==200){
                commit('REQ_CATELIST',res.list)
            }
        })
    }
} 


export default {
    state,
    getters,
    mutations,
    actions,
    namespaced:true
}